import { defineStore } from 'pinia'
export const useStore = defineStore('main', {
    state: () => {
        return {
            users: {},
            roles: [],
            depts: [],
            token: '',
            table: {
                tableColumn: [],
                tableConfig: {
                    border: false,
                    rowHeight: 45,
                    size: false,
                    stripe: false,
                },
            },
            menu: {
                collapsed: false,
                openKeys: [],
                routerTabs: [],
            },
            config: {
                primaryColor: '#1890ff',
                showTabs: false,
                showBreadcrumb: false,
                routerAnimate: 'animate__fadeIn',
                plateStyle: 'normal',
                menuTheme: 'normal',
                isDark: false,
                menuLock: false,
                compact: false,
            },
            model: {
                themeShow: false,
            },
            buttonStatus: false,
        }
    },
    getters: {},
    actions: {},
    persist: {
        enabled: true,
        strategies: [
            {
                key: 'dh_pc_system',
                storage: window.localStorage,
                paths: ['menu', 'table', window.isDev ? 'config' : 'config'],
            },
            {
                key: 'dh_pc_userInfo',
                storage: window.localStorage,
                paths: ['users', 'roles', 'depts', 'token'],
            },
        ],
    },
})
